package com.wpx.log.core.handler.field.equals;

import java.util.Date;

import org.springframework.stereotype.Component;

@Component
public class DateFieldEqualsPolicy implements IFieldEqualsPolicy {

	@Override
	public Class<?> getType() {
		return Date.class;
	}

	@Override
	public boolean equals(Object newValue, Object oldValue) {
		if(newValue == null) {
			return true;
		}
		Date nnew = (Date)newValue;
		Date old = (Date)oldValue;
		return nnew.getTime() == old.getTime();
	}

}
